/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upeu.modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;

/**
 *
 * @author pc
 */
@Entity
@Table(name = "DOCENTE")
@NamedQueries({
    @NamedQuery(name = "Docente.findAll", query = "SELECT d FROM Docente d")})
public class Docente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "DOCENTE_ID")
    private String docenteId;
    @Basic(optional = false)
    @Column(name = "CODIGO")
    private String codigo;
    @Basic(optional = false)
    @Column(name = "ESTADO")
    private String estado;
    @Basic(optional = false)
    @Column(name = "GRADO_ACD")
    private String gradoAcd;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docenteId")
    private Collection<Asistencia> asistenciaCollection;
    @JoinColumn(name = "PERSONA_ID", referencedColumnName = "PERSONA_ID")
    @ManyToOne(optional = false)
    private Persona personaId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docenteId")
    private Collection<Cargadocente> cargadocenteCollection;

    public Docente() {
    }

    public Docente(String docenteId) {
        this.docenteId = docenteId;
    }

    public Docente(String docenteId, String codigo, String estado, String gradoAcd) {
        this.docenteId = docenteId;
        this.codigo = codigo;
        this.estado = estado;
        this.gradoAcd = gradoAcd;
    }

    public String getDocenteId() {
        return docenteId;
    }

    public void setDocenteId(String docenteId) {
        this.docenteId = docenteId;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public String getGradoAcd() {
        return gradoAcd;
    }

    public void setGradoAcd(String gradoAcd) {
        this.gradoAcd = gradoAcd;
    }

    public Collection<Asistencia> getAsistenciaCollection() {
        return asistenciaCollection;
    }

    public void setAsistenciaCollection(Collection<Asistencia> asistenciaCollection) {
        this.asistenciaCollection = asistenciaCollection;
    }

    public Persona getPersonaId() {
        return personaId;
    }

    public void setPersonaId(Persona personaId) {
        this.personaId = personaId;
    }

    public Collection<Cargadocente> getCargadocenteCollection() {
        return cargadocenteCollection;
    }

    public void setCargadocenteCollection(Collection<Cargadocente> cargadocenteCollection) {
        this.cargadocenteCollection = cargadocenteCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (docenteId != null ? docenteId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Docente)) {
            return false;
        }
        Docente other = (Docente) object;
        if ((this.docenteId == null && other.docenteId != null) || (this.docenteId != null && !this.docenteId.equals(other.docenteId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upeu.modelo.Docente[ docenteId=" + docenteId + " ]";
    }
    
}
